package org.bee.rest.id.server.startup;

import java.util.HashMap;
import java.util.Map;

import org.bee.rest.id.server.filter.WebServiceFilter;
import org.bee.rest.id.server.resource.JerseyApplication;
import org.bee.rest.id.server.resource.JerseyServletContainer;

import com.google.inject.servlet.ServletModule;

public class JerseyServletModule extends ServletModule
{
	@Override
	protected void configureServlets()
	{
		filter("/rest/*").through(WebServiceFilter.class);
		
		final Map<String, String> params = new HashMap<String, String>();
		params.put("javax.ws.rs.Application", JerseyApplication.class.getName());
		serve("/rest/*").with(JerseyServletContainer.class, params);
	}
}
